/*
 * @(#) TimeFormatUtil.java 2013-5-28 下午1:28:00
 *
 * Copyright 2013 Rockwell Automation, Inc. All rights reserved.
 * Rockwell Automation PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */package com.osi.mes.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import com.datasweep.compatibility.ui.Time;

public class TimeFormatUtils
{
	public static String formatLongDate(Time time)
	{
		String str = "";
		if (time != null)
		{
			Calendar calendar = time.getCalendar();
			SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			str = formatter.format(calendar.getTime());
		}
		return str;
	}
	
	public static String formatShortDate(Time time)
	{
		String str = "";
		if (time != null)
		{
			Calendar calendar = time.getCalendar();
			SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd");
			str = formatter.format(calendar.getTime());
		}
		return str;
	}
}
